package ahblue.cn.tanzi.util;

import android.content.Context;
import android.text.TextUtils;

import ahblue.cn.tanzi.jmessage.im.util.ToastUtil;

/**
 * @author rhino
 * @since Create on 2019/2/24.
 **/
public class VipUtils {

    /**
     * 判断是不是充值会员
     */
    public static boolean checkVip(Context context) {
        SharePreferenceUtil sharePreferenceUtil = new SharePreferenceUtil(context);
        String expiredTime = sharePreferenceUtil.getExpiredTime();
        if (TextUtils.isEmpty(expiredTime)){
            ToastUtil.shortToast(context,"请开通会员享受更多权益和现金奖励");
            return false;
        }
        long l = TimeUtils.getMillisSecond(expiredTime, "yyyy-MM-dd");
        if (l< System.currentTimeMillis()){
            ToastUtil.shortToast(context,"请开通会员享受更多权益和现金奖励");
            return false;
        }
        return true;
    }

}
